package com.zhang.config;

import com.zhang.vo.Student;
import org.springframework.context.annotation.*;

@Configuration
@ImportResource(value = {"classpath:applicationContext.xml","classpath:beans.xml"})
@PropertySource(value = "classpath:config.properties")
@ComponentScan(basePackages = "com.zhang.vo")
public class SpringConfig {

    @Bean
    public Student crateStudent(){
        Student student1=new Student();
        student1.setName("张三");
        student1.setAge(24);
        student1.setSex("男");
        return student1;
    }

    @Bean(name = "listStudent")
    public Student makeStudent(){
        Student student2 =new Student();
        student2.setName("王傻逼");
        student2.setAge(25);
        student2.setSex("男");
        return student2;
    }
}
